package com.coocaa.typhoon.api.v1.userfile.service;

import com.coocaa.typhoon.api.v1.userfile.model.input.GetSearchDataModel;
import com.coocaa.typhoon.api.v1.userfile.model.output.SearchResultMgrModel;
import com.coocaa.typhoon.api.v1.userfile.model.output.SearchResultModel;
import com.coocaa.typhoon.api.v1.userfile.util.FileTypeCheckUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author bijiahao
 * @date : 2025/9/26 15:51
 * @description
 */
@Service
public class UserSearchMgrService {
    @Autowired
    private UserFileService userFileService;

    public SearchResultMgrModel searchMultiModal(GetSearchDataModel dataModel) {
        String fileType = dataModel.getFileType();
        SearchResultMgrModel res = new SearchResultMgrModel();
        switch (fileType) {
            case "history":
                break;
            default:
                List<SearchResultModel> searchResultModelList = userFileService.searchMultiModal(dataModel);
                res.setResult(searchResultModelList);
                res.setType(StringUtils.isBlank(dataModel.getFileType()) ? FileTypeCheckUtil.IMAGE : dataModel.getFileType());

        }
        return res;
    }

}
